<#--  BEGIN：获取父关系路由参数  -->
<#macro getDeResParameters currentView>
  <#if currentView.isPSDEView()>
    [
    <#if currentView.getPSAppDERSPathCount() gt 0>
      <#list currentView.getPSAppDERSPath(currentView.getPSAppDERSPathCount() - 1) as deRSPath>
      <#assign majorPSAppDataEntity = deRSPath.getMajorPSAppDataEntity()/>
        { pathName: '${srfpluralize(majorPSAppDataEntity.codeName)?lower_case}', parameterName: '${majorPSAppDataEntity.getCodeName()?lower_case}' }, 
      </#list>
    </#if>
    ]
  <#else>
    []
  </#if>
</#macro>
<#--  END：获取父关系路由参数  -->

<#--  BEGIN：获取视图本身路由参数  -->
<#macro getParameters currentView>
  [
  <#if currentView.isPSDEView()>
    <#assign appDataEntity = currentView.getPSAppDataEntity()/>
    { pathName: '${srfpluralize(appDataEntity.codeName)?lower_case}', parameterName: '${appDataEntity.getCodeName()?lower_case}' }, 
    { pathName: '${currentView.getPSDEViewCodeName()?lower_case}', parameterName: '${currentView.getPSDEViewCodeName()?lower_case}' } 
  <#else>
    { pathName: '${currentView.getCodeName()?lower_case}', parameterName: '${currentView.getCodeName()?lower_case}' } 
  </#if>
  ]
</#macro>
<#--  END：获取视图本身路由参数  -->

<#--  BEGIN：插入空格  -->
<#macro insertBlank num>
  <#assign blank_space = " " />
  <#list 1..num as i>
  ${blank_space}<#t>
  </#list>
</#macro>
<#--  END：插入空格  -->

<#--  BEGIN：表格列标题自定义绘制  -->
<#macro getColumnHeader item blankNum>
<@insertBlank blankNum /><template v-slot:header="{column}">
<@insertBlank blankNum />  <span class="column-header <#if item.getHeaderPSSysCss?? && item.getHeaderPSSysCss()??>${item.getHeaderPSSysCss().getCssName()}</#if>">
                         <#if item.getPSSysImage?? && item.getPSSysImage()??>
                           <#assign img=item.getPSSysImage()>
<@insertBlank blankNum />      <i class='<#if img.getCssClass?? && img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i>
                         </#if>
<@insertBlank blankNum />    {{<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>}}
<@insertBlank blankNum />  </span>
<@insertBlank blankNum /></template>
</#macro>
<#--  END：表格列标题自定义绘制  -->
<#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../../@MACRO/LANG_FUN.ftl
</#ibizinclude>
<template v-if="getColumnState('${item.getName()?lower_case}')">
<#if item.getColumnType() == 'GROUPGRIDCOLUMN' && item.getPSDEGridColumns()??>
<#--  [1]BEGIN：分组列  -->
    <el-table-column show-overflow-tooltip :align="'${item.getAlign()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>">
    <@getColumnHeader item 4 />
    <#list item.getPSDEGridColumns() as column>
        ${P.getPartCode(column,'COLUMN').code}
    </#list>
    </el-table-column>
<#--  [1]END：分组列  -->
<#elseif item.getColumnType() == 'UAGRIDCOLUMN'>
<#--  [2]BEGIN：操作列  -->
    <el-table-column :column-key="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'">
        <@getColumnHeader item 8 />
        <template slot-scope="scope">
            <div style="text-align: center;">
  <#if item.getPSDEUIActionGroup().getPSDEUIActions()??>
    <#list item.getPSDEUIActionGroup().getPSUIActionGroupDetails() as uiactionDetail>
      <#if uiactionDetail.getPSUIAction?? && uiactionDetail.getPSUIAction()??>
        <#assign uiaction = uiactionDetail.getPSUIAction() />
        <#--  取消分割线标签，使用样式替代分割线 start -->
        <#--  @author ljy  -->
        <#--  @update 2020.7.21 -->
        <#--  <#if preUIAction??>
                <divider type='vertical' v-show="scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled" ></divider>
        </#if>  -->
        <#if !uiactionDetail.isShowCaption()>
                <tooltip :transfer="true" :max-width="600">
        </#if>
                <a v-show="scope.row.${uiaction.getUIActionTag()}.visabled" <#if !preUIAction??>:class="{'grid-first-uiaction':scope.row.${uiaction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> <#if preUIAction??>:class="{'grid-uiaction-divider':scope.row.${preUIAction.getUIActionTag()}.visabled && scope.row.${uiaction.getUIActionTag()}.visabled}"</#if> :style="{'pointer-events':scope.row.${uiaction.getUIActionTag()}.disabled?'none':'auto'}" @click="uiAction(scope.row, '${uiaction.getUIActionTag()}', $event)">
        <#--  取消分割线标签，使用样式替代分割线 end -->
                  <#if uiactionDetail.isShowIcon()><i class='<#if uiaction.getIconCls?? && uiaction.getIconCls()??>${uiaction.getIconCls()}</#if>'></i></#if>
                  <#if uiactionDetail.isShowCaption()>{{<#if langbase??>$t('${langbase}.uiactions.${uiaction.getFullCodeName()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</#if>
                </a>
        <#if !uiactionDetail.isShowCaption()>
                <div slot='content'>{{<#if langbase??>$t('${langbase}.uiactions.<#if uiaction.getPSAppDataEntity?? && uiaction.getPSAppDataEntity()??>${uiaction.getPSAppDataEntity().getCodeName()?lower_case}_</#if>${uiaction.getUIActionTag()?lower_case}')<#else>'${uiaction.getCaption()}'</#if>}}</div>
                </tooltip>
        </#if>
        <#assign preUIAction = uiaction />
      </#if>
    </#list>
  </#if>
            </div>
        </template>
    </el-table-column>
<#--  [2]END：操作列  -->
<#elseif item.getColumnType() == 'DEFGRIDCOLUMN'>
<#--  [3]BEGIN：数据列  -->
    <el-table-column show-overflow-tooltip :prop="'${item.getName()?lower_case}'" :label="<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>"<#if item.getWidthUnit()!='STAR'> :width="${item.width?c}" <#else> :min-width="${item.width?c}" </#if> :align="'${item.getAlign()?lower_case}'"<#if (!ctrl.isNoSort()) && item.isEnableSort()> :sortable="'custom'"</#if>>
        <@getColumnHeader item 8 />
        <template v-slot="{row,column,$index}">
        <#if (item.render??) || (item.getCodeList()?? && item.getCLConvertMode() == 'FRONT') || item.isEnableRowEdit()>
        <#--  BEGIN：列绘制、前端绘制代码表、行编辑  -->
            <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>
            <#--  BEGIN：行编辑  -->
              <#if (item.render??)>
              <#--  BEGIN：列绘制  -->
                    <span>${item.render.code}</span>
              <#--  END：列绘制  -->
              <#else>
            <template v-if="actualIsOpenEdit">
                <app-form-item :error="gridItemsModel[$index][column.property].error">
                    ${P.getEditorCode(item, "GRIDEIDTOR.vue").code}
                </app-form-item>
            </template>
              </#if>
            <#--  END：行编辑  -->
            </#if>
            <template <#if (ctrl.isEnableRowEdit() && item.isEnableRowEdit())>v-if="!actualIsOpenEdit"</#if>>
                <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
                <a @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
                </#if>
                <#if (item.render??)>
                <#--  BEGIN：列绘制  -->
                    <span>${item.render.code}</span>
                <#--  END：列绘制  -->
                <#elseif (item.getCodeList()?? && item.getCLConvertMode() == 'FRONT')>
                <#--  BEGIN：前端绘制代码表  --> 
                <#assign codelist = item.getPSCodeList()>
                <#if codelist.getCodeListType() == 'STATIC' || codelist.getCodeListType() == 'DYNAMIC'>
                    <codelist <#t>
                      :value="row.${item.getName()?lower_case}" <#t>
                      <#assign codelist=item.getPSCodeList() />
                      tag='${codelist.codeName}' <#t>
                      codelistType='${codelist.getCodeListType()}' <#t>
                    <#if codelist.getOrMode?? && codelist.getOrMode()?has_content>
                      renderMode="${codelist.getOrMode()}" <#t>
                    </#if>
                    <#if codelist.valueSeparator?has_content>
                      valueSeparator="${codelist.valueSeparator}" <#t>
                    </#if>
                    <#if codelist.textSeparator?has_content>
                      textSeparator="${codelist.textSeparator}" <#t>
                    </#if>><#t>
                    </codelist><#lt>
                </#if>
                <#--  END：前端绘制代码表  -->
                <#else>
                  <#if item.isEnableLinkView()>
                  <#-- 支持链接视图-->
                  <#if item.getLinkPSAppView()??>
                  <#assign dataview = item.getLinkPSAppView() />
                  <#assign appLinkView>
                    viewname: '${srffilepath2(dataview.getCodeName())}', height: ${dataview.getHeight()?c},width: ${dataview.getWidth()?c},title: <@getViewLanguageTitle dataview />,placement: '${dataview.getOpenMode()}', isRedirectView: <#if dataview.isRedirectView()>true<#else>false</#if>,deResParameters: <@getDeResParameters dataview />,parameters: <@getParameters dataview />
                  </#assign>
                  </#if>
                  <app-column-link 
                    deKeyField='<#if dataview.isPSDEView()>${dataview.getPSAppDataEntity().getCodeName()?lower_case}</#if>' 
                    :context="JSON.parse(JSON.stringify(context))" 
                    :viewparams="JSON.parse(JSON.stringify(viewparams))" 
                    :data="row" 
                    :linkview="{<#compress><#if appLinkView??>${appLinkView}</#if></#compress>}"
                    valueitem="<#if item.getLinkValueItem()??>${item.getLinkValueItem()}</#if>">
                  <#--  BEGIN：常规显示  -->
                  <#if item.getPSDEGridEditItem()?? && item.getPSDEGridEditItem().getPSEditorType?? && item.getPSDEGridEditItem().getPSEditorType()??>
                    <app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}"></app-span>
                  <#else>
                    <span>{{row.${item.getName()?lower_case}}}</span>
                  </#if>
                  </app-column-link>
                  <#else>
                  <#if item.getPSDEGridEditItem()?? && item.getPSDEGridEditItem().getPSEditorType?? && item.getPSDEGridEditItem().getPSEditorType()??>
                    <app-span name='${item.name}' editorType="${item.getPSDEGridEditItem().getPSEditorType().getStandardPSEditorType()}" :value="row.${item.getName()?lower_case}" <#t>
                    <#if item.getPSDEField().getDataType()!="">
                      dataType="${item.getPSDEField().getDataType()}" <#t>
                    </#if>
                    <#if item.getPSDEField().getPrecision()??>
                      precision="${item.getPSDEField().getPrecision()}" <#t></#if>></app-span>
                  <#else>
                  <#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
                    <app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
                  <#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")>
                    <app-format-data dataType="${item.getPSDEField().getDataType()}" precision="${item.getPSDEField().getPrecision()}" :data="row.${item.getName()?lower_case}"></app-format-data>
                  <#else>
                    <span>{{row.${item.getName()?lower_case}}}</span>
                  </#if>
                  </#if>
                  </#if>
                <#--  END：常规显示  -->
                </#if>
                <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
                </a>
                </#if>
            </template>
        <#--  END：列绘制、前端绘制代码表、行编辑  -->
        <#else>
          <#if item.isEnableLinkView()>
            <#-- 支持链接视图-->
              <#if item.getLinkPSAppView()??>
                <#assign dataview = item.getLinkPSAppView() />
                <#assign appLinkView>
                viewname: '${srffilepath2(dataview.getCodeName())}', height: ${dataview.getHeight()?c},width: ${dataview.getWidth()?c},title: <@getViewLanguageTitle dataview />,placement: '${dataview.getOpenMode()}', isRedirectView: <#if dataview.isRedirectView()>true<#else>false</#if>,deResParameters: <@getDeResParameters dataview />,parameters: <@getParameters dataview />
                </#assign>
              </#if>
            <app-column-link deKeyField='<#if dataview.isPSDEView()>${dataview.getPSAppDataEntity().getCodeName()?lower_case}</#if>' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{<#compress><#if appLinkView??>${appLinkView}</#if></#compress>}" valueitem="<#if item.getLinkValueItem()??>${item.getLinkValueItem()}</#if>">
                <span>{{row.${item.getName()?lower_case}}}</span>
            </app-column-link >
          <#else>
            <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
            <a @click="uiAction(row, '${item.getPSDEUIAction().getUIActionTag()}', $event)">
            </#if>
            <#if item.getValueFormat()?? && item.getValueFormat() != "%1$s">
            <app-format-data format="${item.getValueFormat()}" :data="row.${item.getName()?lower_case}"></app-format-data>
            <#elseif item.getPSDEField?? && item.getPSDEField()?? && (item.getPSDEField().getDataType() == "DECIMAL" || item.getPSDEField().getDataType() == "FLOAT" || item.getPSDEField().getDataType() == "CURRENCY")>
                <app-format-data dataType="${item.getPSDEField().getDataType()}" precision="${item.getPSDEField().getPrecision()}" :data="row.${item.getName()?lower_case}"></app-format-data>
            <#else>
            <span>{{row.${item.getName()?lower_case}}}</span>
            </#if>
            <#if item.getPSDEUIAction?? && item.getPSDEUIAction()??>
            </a>
            </#if>
          </#if>
         </#if>
        </template>
    </el-table-column>
<#--  [3]END：数据列  -->
</#if>
</template>

